home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / UNIX / PASCAL / PTOC / PTC.PAT < prev    next >
Text File  |  1992-11-23  |  33KB  |  1,317 lines

  1. *** ptc.p    Fri Nov 13 18:45:21 1987
  2. --- nptc.p    Fri Nov 13 18:44:29 1987
  3. ***************
  4. *** 42,48 ****
  5.   (**    The code generated by the translator assumes that there    is a      **)
  6.   (**    C-implementation with at least a reasonable <stdio> library      **)
  7.   (**    since all input/output is implemented in terms of C functions      **)
  8. ! (**    like fprintf(), getc(), fopen(), rewind() etc.              **)
  9.   (**    If the source-program uses Pascal functions like sin(), sqrt()      **)
  10.   (**    etc, there must also exist such functions in the C-library.      **)
  11.   (**                                      **)
  12. --- 42,48 ----
  13.   (**    The code generated by the translator assumes that there    is a      **)
  14.   (**    C-implementation with at least a reasonable <stdio> library      **)
  15.   (**    since all input/output is implemented in terms of C functions      **)
  16. ! (**    like fprintf(), getc(), fopen(), fseek() etc.              **)
  17.   (**    If the source-program uses Pascal functions like sin(), sqrt()      **)
  18.   (**    etc, there must also exist such functions in the C-library.      **)
  19.   (**                                      **)
  20. ***************
  21. *** 53,59 ****
  22.   
  23.   label    9999;                (* end of program        *)
  24.   
  25. ! const    version        = '@(#)ptc.p    1.5  Date 87/05/01';
  26.   
  27.       keytablen    = 38;        (* nr of keywords        *)
  28.       keywordlen    = 10;        (* length of a keyword        *)
  29. --- 53,59 ----
  30.   
  31.   label    9999;                (* end of program        *)
  32.   
  33. ! const    version        = '@(#)ptc.p    2.6  Date 87/09/12';
  34.   
  35.       keytablen    = 38;        (* nr of keywords        *)
  36.       keywordlen    = 10;        (* length of a keyword        *)
  37. ***************
  38. *** 67,75 ****
  39.       setbits        = 15;            (* CPU *)
  40.   
  41.       (* a Pascal file is implemented as a struct which (among other    *)
  42. !     (* things) contain a flag-field, currently 3 bits are used    *)
  43.       filebits    = 'unsigned short';    (* flags for files    *)
  44. !     filefill    = 12;            (* 16 less used 3 bits    *)
  45.   
  46.       maxsetrange    = 15;            (* nr of words in a set    *)
  47.       scalbase    = 0;    (* ordinal value of first scalar member    *)
  48. --- 67,75 ----
  49.       setbits        = 15;            (* CPU *)
  50.   
  51.       (* a Pascal file is implemented as a struct which (among other    *)
  52. !     (* things) contain a flag-field, currently 4 bits are used    *)
  53.       filebits    = 'unsigned short';    (* flags for files    *)
  54. !     filefill    = 12;            (* 16 less used 4 bits    *)
  55.   
  56.       maxsetrange    = 15;            (* nr of words in a set    *)
  57.       scalbase    = 0;    (* ordinal value of first scalar member    *)
  58. ***************
  59. *** 106,111 ****
  60. --- 106,112 ----
  61.          temporary files for reset/rewrite, the last character is supplied
  62.          by the reset/rewrite routine *)
  63.       tmpfilename    = '"/tmp/ptc%d%c", getpid(), '; (* OS *)
  64. +     maxfilename    = 'MAXFILENAME';
  65.   
  66.       (* some frequently used characters *)
  67.       space        = ' ';
  68. ***************
  69. *** 146,151 ****
  70. --- 147,154 ----
  71.       voidtyp        = 'void';    (* for procedures         *)
  72.       voidcast    = '(void)';
  73.   
  74. +     align        = true;        (* align literal params        *)
  75.       intlen        = 10;        (* length of written integer    *)
  76.       fixlen        = 20;        (* length of written real    *)
  77.   
  78. ***************
  79. *** 239,244 ****
  80. --- 242,264 ----
  81.             sinteger:    (vint    : integer);
  82.             sreal:    (vflt    : strindx);
  83.             sstring:    (vstr    : strindx);
  84. +           sand,        sarray,        sbegin,        scase,
  85. +           sconst,    sdiv,        sdo,        sdownto,
  86. +           selse,    send,        sextern,    sfile,
  87. +           sfor,        sforward,    sfunc,        sgoto,
  88. +           sif,        sinn,        slabel,        smod,
  89. +           snil,        snot,        sof,        sor,
  90. +           sother,    spacked,    sproc,        spgm,
  91. +           srecord,    srepeat,    sset,        sthen,
  92. +           sto,        stype,        suntil,        svar,
  93. +           swhile,    swith,        seof,
  94. +           splus,    sminus,        smul,        squot,
  95. +           sarrow,    slpar,        srpar,        slbrack,
  96. +           srbrack,    seq,        sne,        slt,
  97. +           sle,        sgt,        sge,        scomma,
  98. +           scolon,    ssemic,        sassign,    sdotdot,
  99. +           sdot:        ()
  100.           end;
  101.   
  102.       (* enumeration of symnode variants *)
  103. ***************
  104. *** 648,653 ****
  105. --- 668,674 ----
  106.           cstdout,    cstderr,    cstrncmp,    cstrncpy,
  107.           cstruct,    cstatic,    cswitch,    ctypedef,
  108.           cundef,        cungetc,    cunion,        cunlink,
  109. +         cfseek,        cgetchar,    cputchar,
  110.           cunsigned,    cwrite
  111.       );
  112.   
  113. ***************
  114. *** 661,667 ****
  115.           enew,        esetbase,    esetsize,    eoverflow,
  116.           etree,        etag,        euprconf,    easgnconf,
  117.           ecmpconf,    econfconf,    evrntfile,    evarfile,
  118. !         emanymachs,    ebadmach
  119.       );
  120.   
  121.       machdefstr = packed array [ 1 .. machdeflen ] of char;
  122. --- 682,688 ----
  123.           enew,        esetbase,    esetsize,    eoverflow,
  124.           etree,        etag,        euprconf,    easgnconf,
  125.           ecmpconf,    econfconf,    evrntfile,    evarfile,
  126. !         emanymachs,    ebadmach,    eprconf
  127.       );
  128.   
  129.       machdefstr = packed array [ 1 .. machdeflen ] of char;
  130. ***************
  131. *** 683,688 ****
  132. --- 704,711 ----
  133.       useins,
  134.       usescpy,
  135.       usecomp,        (* source program uses string-compare    *)
  136. +     usealig,        (* source program uses aligned params    *)
  137. +     usesal,
  138.       usefopn,        (* source program uses reset/rewrite    *)
  139.       usescan,
  140.       usegetl,
  141. ***************
  142. *** 738,745 ****
  143.   
  144.       varno    : integer;        (* counter for unique id's    *)
  145.   
  146. !     hexdig    : packed array [ 0 .. 15 ] of char;
  147.   
  148.   (*    Prtmsg produces an error message. It asssumes that procedure    *)
  149.   (*    "message" (predefined) will "writeln" to user tty. OS        *)
  150.   procedure prtmsg(m : errors);
  151. --- 761,771 ----
  152.   
  153.       varno    : integer;        (* counter for unique id's    *)
  154.   
  155. !     pushchr    : char;            (* pushback for lexical scanner    *)
  156. !     pushed    : boolean;
  157.   
  158. +     hexdig    : array [ 0 .. 15 ] of char;
  159.   (*    Prtmsg produces an error message. It asssumes that procedure    *)
  160.   (*    "message" (predefined) will "writeln" to user tty. OS        *)
  161.   procedure prtmsg(m : errors);
  162. ***************
  163. *** 814,819 ****
  164. --- 840,847 ----
  165.           message(restr, 'Too many machine integer types');
  166.         ebadmach:
  167.           message(inter, 'Bad name for machine integer type');
  168. +       eprconf:
  169. +         message(restr, 'Cannot write conformant arrays');
  170.       end;(* case *)
  171.       if lastline <> 0 then
  172.           begin
  173. ***************
  174. *** 1219,1225 ****
  175.       var    c    : char;
  176.   
  177.       begin
  178. !         if eof then
  179.               c := chr(null)
  180.           else begin
  181.               colno := colno + 1;
  182. --- 1247,1258 ----
  183.       var    c    : char;
  184.   
  185.       begin
  186. !         if pushed then
  187. !             begin
  188. !             c := pushchr;
  189. !             pushed := false
  190. !             end
  191. !         else if eof then
  192.               c := chr(null)
  193.           else begin
  194.               colno := colno + 1;
  195. ***************
  196. *** 1235,1241 ****
  197.                   else
  198.                       write(c);
  199.               if c = tab1 then
  200. !                 colno := ((colno div tabwidth) + 1) * tabwidth
  201.                end;
  202.           if lastchr > 0 then
  203.               begin
  204. --- 1268,1275 ----
  205.                   else
  206.                       write(c);
  207.               if c = tab1 then
  208. !                 colno := (((colno - 1) div tabwidth) + 1) *
  209. !                         tabwidth
  210.                end;
  211.           if lastchr > 0 then
  212.               begin
  213. ***************
  214. *** 1249,1255 ****
  215.       function peekchar : char;
  216.   
  217.       begin
  218. !         if eof then
  219.               peekchar := chr(null)
  220.           else
  221.               peekchar := input^
  222. --- 1283,1291 ----
  223.       function peekchar : char;
  224.   
  225.       begin
  226. !         if pushed then
  227. !             peekchar := pushchr
  228. !         else if eof then
  229.               peekchar := chr(null)
  230.           else
  231.               peekchar := input^
  232. ***************
  233. *** 1458,1466 ****
  234.                       end;
  235.                   st := sinteger;
  236.                   vint := n;
  237.                   if realok then
  238.                       begin
  239. -                     (* accept real numbers *)
  240.                       if peekchar = '.' then
  241.                           begin
  242.                           (* this is a real number *)
  243. --- 1494,1508 ----
  244.                       end;
  245.                   st := sinteger;
  246.                   vint := n;
  247. +                 if realok and (peekchar = '.') then
  248. +                     begin
  249. +                     c := nextchar;
  250. +                     realok := numchar(peekchar);
  251. +                     pushchr := c;
  252. +                     pushed := true
  253. +                     end;
  254.                   if realok then
  255.                       begin
  256.                       if peekchar = '.' then
  257.                           begin
  258.                           (* this is a real number *)
  259. ***************
  260. *** 1579,1585 ****
  261.                 quote:
  262.                   begin
  263.                   (* assume the symbol is a literal string *)
  264. !                 wl := 0;
  265.                   ready := false;
  266.                   repeat
  267.                       if eoln then
  268. --- 1621,1627 ----
  269.                 quote:
  270.                   begin
  271.                   (* assume the symbol is a literal string *)
  272. !                 wl := 1;
  273.                   ready := false;
  274.                   repeat
  275.                       if eoln then
  276. ***************
  277. *** 1602,1608 ****
  278.                           end;
  279.                       if not ready then
  280.                           begin
  281. !                         wl := wl + 1;
  282.                           if wl >= maxtoknlen then
  283.                               begin
  284.                               lasttok[lastchr] :=
  285. --- 1644,1650 ----
  286.                           end;
  287.                       if not ready then
  288.                           begin
  289. !                         wb[wl] := c;
  290.                           if wl >= maxtoknlen then
  291.                               begin
  292.                               lasttok[lastchr] :=
  293. ***************
  294. *** 1609,1618 ****
  295.                                   chr(null);
  296.                               error(elongstring)
  297.                               end;
  298. !                         wb[wl] := c
  299.                           end
  300.                   until    ready;
  301. !                 if wl = 1 then
  302.                       begin
  303.                       (* only 1 character => not a string *)
  304.                       st := schar;
  305. --- 1651,1660 ----
  306.                                   chr(null);
  307.                               error(elongstring)
  308.                               end;
  309. !                         wl := wl + 1;
  310.                           end
  311.                   until    ready;
  312. !                 if wl = 2 then
  313.                       begin
  314.                       (* only 1 character => not a string *)
  315.                       st := schar;
  316. ***************
  317. *** 1620,1631 ****
  318.                       end
  319.                   else begin
  320.                       (* > 1 character => its a string *)
  321. -                     wl := wl + 1;
  322. -                     if wl >= maxtoknlen then
  323. -                         begin
  324. -                         lasttok[lastchr] := chr(null);
  325. -                         error(elongstring)
  326. -                         end;
  327.                       wb[wl] := chr(null);
  328.                       st := sstring;
  329.                       vstr := savestr(wb)
  330. --- 1662,1667 ----
  331. ***************
  332. *** 2645,2650 ****
  333. --- 2681,2687 ----
  334.                           sproc, sfunc, sbegin]);
  335.           pbody(tp);
  336.           checksymbol([sdot]);
  337. +         nextsymbol([seof]);
  338.           tp^.tscope := currscope;
  339.           leavescope;
  340.           pprogram := tp
  341. ***************
  342. *** 2662,2668 ****
  343.           tp^.tsubid := nil;
  344.           tp^.tsubpar := nil;
  345.           pbody(tp);
  346. !         checksymbol([ssemic]);
  347.           tp^.tscope := currscope;
  348.           leavescope;
  349.           pmodule := tp
  350. --- 2699,2707 ----
  351.           tp^.tsubid := nil;
  352.           tp^.tsubpar := nil;
  353.           pbody(tp);
  354. !         checksymbol([ssemic, seof]);
  355. !         if currsym.st = ssemic then
  356. !             nextsymbol([seof]);
  357.           tp^.tscope := currscope;
  358.           leavescope;
  359.           pmodule := tp
  360. ***************
  361. *** 2799,2805 ****
  362.               enterscope(dp);
  363.               dp := currscope
  364.               end;
  365. !         nextsymbol([sid, scase] + [cs]);
  366.           tq := nil;
  367.           while currsym.st = sid do
  368.               begin
  369. --- 2838,2844 ----
  370.               enterscope(dp);
  371.               dp := currscope
  372.               end;
  373. !         nextsymbol([sid, scase, cs]);
  374.           tq := nil;
  375.           while currsym.st = sid do
  376.               begin
  377. ***************
  378. *** 2820,2826 ****
  379.               tq^.tbind := ptypedef;
  380.               enterscope(dp);
  381.               if currsym.st = ssemic then
  382. !                 nextsymbol([sid, scase] + [cs])
  383.               end;
  384.           if currsym.st = scase then
  385.               begin
  386. --- 2859,2865 ----
  387.               tq^.tbind := ptypedef;
  388.               enterscope(dp);
  389.               if currsym.st = ssemic then
  390. !                 nextsymbol([sid, scase, cs])
  391.               end;
  392.           if currsym.st = scase then
  393.               begin
  394. ***************
  395. *** 2852,2858 ****
  396.                   tv := nil;
  397.                   repeat
  398.                       nextsymbol([sid, sinteger, schar, splus,
  399. !                              sminus] + [cs]);
  400.                       if currsym.st = cs then
  401.                           goto 999;
  402.                       if tv = nil then
  403. --- 2891,2897 ----
  404.                   tv := nil;
  405.                   repeat
  406.                       nextsymbol([sid, sinteger, schar, splus,
  407. !                              sminus, cs]);
  408.                       if currsym.st = cs then
  409.                           goto 999;
  410.                       if tv = nil then
  411. ***************
  412. *** 3650,3655 ****
  413. --- 3689,3696 ----
  414.                   tq^.tnext := mknode(nchoise);
  415.                   tq := tq^.tnext
  416.                    end;
  417. +             tq^.tchocon := nil;
  418. +             tq^.tchostmt := nil;
  419.               tv := nil;
  420.               repeat
  421.                   nextsymbol([sid, sinteger, schar,
  422. ***************
  423. *** 3845,3852 ****
  424.       if currsym.st = spgm then
  425.           top := pprogram
  426.       else
  427. !         top := pmodule;
  428. !     nextsymbol([seof]);
  429.   end;    (* parse *)
  430.   
  431.   (*    Compute value for a node (which must be some kind of constant).    *)
  432. --- 3886,3892 ----
  433.       if currsym.st = spgm then
  434.           top := pprogram
  435.       else
  436. !         top := pmodule
  437.   end;    (* parse *)
  438.   
  439.   (*    Compute value for a node (which must be some kind of constant).    *)
  440. ***************
  441. *** 4317,4328 ****
  442.                           move := true;
  443.                           sp := ip^.tsym;
  444.                           if sp^.lid^.inref > 1 then
  445. -                           begin
  446.                               sp^.lid :=
  447. !                             mkrename( 'M', sp^.lid);
  448. !                             sp^.lid^.inref :=
  449. !                                 sp^.lid^.inref - 1
  450. !                           end;
  451.                           ip := nil
  452.                           end
  453.                       else
  454. --- 4357,4364 ----
  455.                           move := true;
  456.                           sp := ip^.tsym;
  457.                           if sp^.lid^.inref > 1 then
  458.                               sp^.lid :=
  459. !                             mkrename('M', sp^.lid);
  460.                           ip := nil
  461.                           end
  462.                       else
  463. ***************
  464. *** 4619,4624 ****
  465. --- 4655,4662 ----
  466.   
  467.                   (* mark those used in nested subroutines *)
  468.                   global(tp^.tsubsub, tp, false);
  469. +                 global(tp^.tsubvar, tp, false);
  470. +                 global(tp^.tsubtype, tp, false);
  471.   
  472.                   (* move out variables used in inner scope *)
  473.                   movevars(tp, tp^.tsubpar);
  474. ***************
  475. *** 4887,4896 ****
  476.                      a unique name *)
  477.                   sp := tp^.tsubid^.tsym;
  478.                   if sp^.lid^.inref > 1 then
  479. !                     begin
  480. !                     sp^.lid := mkrename('P', sp^.lid);
  481. !                     sp^.lid^.inref := sp^.lid^.inref - 1
  482. !                     end
  483.                   end;
  484.               tp := tp^.tnext
  485.               end
  486. --- 4925,4931 ----
  487.                      a unique name *)
  488.                   sp := tp^.tsubid^.tsym;
  489.                   if sp^.lid^.inref > 1 then
  490. !                     sp^.lid := mkrename('P', sp^.lid)
  491.                   end;
  492.               tp := tp^.tnext
  493.               end
  494. ***************
  495. *** 5131,5136 ****
  496. --- 5166,5172 ----
  497.   
  498.   const    include    = '# include ';
  499.       define    = '# define ';
  500. +     undef    = '# undef ';
  501.       ifdef    = '# ifdef ';
  502.       ifndef    = '# ifndef ';
  503.       elsif    = '# else';
  504. ***************
  505. *** 5145,5152 ****
  506.   var    conflag,
  507.       setused,
  508.       dropset,
  509. -     donearr    : boolean;
  510.       doarrow,
  511.       indnt    : integer;
  512.   
  513.       procedure increment;
  514. --- 5181,5188 ----
  515.   var    conflag,
  516.       setused,
  517.       dropset,
  518.       doarrow,
  519. +     donearr    : boolean;
  520.       indnt    : integer;
  521.   
  522.       procedure increment;
  523. ***************
  524. *** 5203,5216 ****
  525.       (*    Emit code to select a record member.    *)
  526.       procedure eselect(tp : treeptr);
  527.   
  528.       begin
  529. !         doarrow := doarrow + 1;
  530.           eexpr(tp);
  531. -         doarrow := doarrow - 1;
  532.           if donearr then
  533.               donearr := false
  534.           else
  535. !             write('.')
  536.       end;
  537.   
  538.       (*    Emit code for call to a predefined function/procedure.    *)
  539. --- 5239,5255 ----
  540.       (*    Emit code to select a record member.    *)
  541.       procedure eselect(tp : treeptr);
  542.   
  543. +     var    da    : boolean;
  544.       begin
  545. !         da := doarrow;
  546. !         doarrow := true;
  547.           eexpr(tp);
  548.           if donearr then
  549.               donearr := false
  550.           else
  551. !             write('.');
  552. !         doarrow := da
  553.       end;
  554.   
  555.       (*    Emit code for call to a predefined function/procedure.    *)
  556. ***************
  557. *** 5435,5441 ****
  558.                           else
  559.                               write('*.*');
  560.                       write('s')
  561. !                      end
  562.               end (* case *)
  563.           end;    (* eformat *)
  564.   
  565. --- 5474,5482 ----
  566.                           else
  567.                               write('*.*');
  568.                       write('s')
  569. !                      end;
  570. !               'v':
  571. !                 fatal(eprconf)
  572.               end (* case *)
  573.           end;    (* eformat *)
  574.   
  575. ***************
  576. *** 5572,5578 ****
  577.                       write(', ');
  578.                       eexpr(tq)
  579.                       end
  580. !                 end
  581.               end (* case *)
  582.           end;    (* ewrite *)
  583.   
  584. --- 5613,5621 ----
  585.                       write(', ');
  586.                       eexpr(tq)
  587.                       end
  588. !                 end;
  589. !               'v':
  590. !                 fatal(eprconf)
  591.               end (* case *)
  592.           end;    (* ewrite *)
  593.   
  594. ***************
  595. *** 6212,6218 ****
  596.               write(', ');
  597.               tq := tp^.taparm^.tnext;
  598.               if tq = nil then
  599. !                 write('NULL')
  600.               else begin
  601.                   tq := typeof(tq);
  602.                   if tq = typnods[tchar] then
  603. --- 6255,6261 ----
  604.               write(', ');
  605.               tq := tp^.taparm^.tnext;
  606.               if tq = nil then
  607. !                 write('NULL, 0')
  608.               else begin
  609.                   tq := typeof(tq);
  610.                   if tq = typnods[tchar] then
  611. ***************
  612. *** 6221,6234 ****
  613.                       ch := chr(cvalof(tp^.taparm^.tnext));
  614.                       if (ch = bslash) or (ch = cite) then
  615.                           write(bslash);
  616. !                     write(ch, cite)
  617.                       end
  618.                   else if tq = typnods[tstring] then
  619. !                     eexpr(tp^.taparm^.tnext)
  620. !                 else  if tq^.tt in [narray, nconfarr] then
  621.                        begin
  622.                       eexpr(tp^.taparm^.tnext);
  623. !                     write('.A')
  624.                        end
  625.                   else
  626.                       fatal(etree)
  627. --- 6264,6282 ----
  628.                       ch := chr(cvalof(tp^.taparm^.tnext));
  629.                       if (ch = bslash) or (ch = cite) then
  630.                           write(bslash);
  631. !                     write(ch, cite, ', -1')
  632.                       end
  633.                   else if tq = typnods[tstring] then
  634. !                     begin
  635. !                     eexpr(tp^.taparm^.tnext);
  636. !                     write(', -1')
  637. !                     end
  638. !                 else if tq^.tt = narray then
  639.                        begin
  640.                       eexpr(tp^.taparm^.tnext);
  641. !                     write('.A, sizeof(');
  642. !                     eexpr(tp^.taparm^.tnext);
  643. !                     write('.A)')
  644.                        end
  645.                   else
  646.                       fatal(etree)
  647. ***************
  648. *** 6487,6507 ****
  649.                           eexpr(tq);
  650.                           write(')')
  651.                           end
  652.                       else
  653.                           eexpr(tq);
  654.                       end
  655. !                 else if (tx = typnods[tstring]) or
  656. !                         (tx = typnods[tset]) then
  657.                       begin
  658. -                     (* cast literal to proper type *)
  659.                       write('*((');
  660.                       etypedef(tf^.tup^.tbind);
  661.                       write(' *)');
  662. !                     if tx = typnods[tset] then
  663.                           begin
  664. !                         dropset := true;
  665.                           eexpr(tq);
  666. !                         dropset := false
  667.                           end
  668.                       else
  669.                           eexpr(tq);
  670. --- 6535,6574 ----
  671.                           eexpr(tq);
  672.                           write(')')
  673.                           end
  674. +                     else if tf^.tup^.tt = nvarpar then
  675. +                         eaddr(tq)
  676.                       else
  677. +                         eexpr(tq)
  678. +                     end
  679. +                 else if tx = typnods[tset] then
  680. +                     begin
  681. +                     write('*((');
  682. +                     etypedef(tf^.tup^.tbind);
  683. +                     write(' *)');
  684. +                     dropset := true;
  685. +                     if align then
  686. +                         begin
  687. +                         usesal := true;
  688. +                         write('SETALIGN(');
  689.                           eexpr(tq);
  690. +                         write(')')
  691. +                         end
  692. +                     else
  693. +                         eexpr(tq);
  694. +                     dropset := false;
  695. +                     write(')')
  696.                       end
  697. !                 else if tx = typnods[tstring] then
  698.                       begin
  699.                       write('*((');
  700.                       etypedef(tf^.tup^.tbind);
  701.                       write(' *)');
  702. !                     if align then
  703.                           begin
  704. !                         usealig := true;
  705. !                         write('STRALIGN(');
  706.                           eexpr(tq);
  707. !                         write(')')
  708.                           end
  709.                       else
  710.                           eexpr(tq);
  711. ***************
  712. *** 6521,6528 ****
  713.                       eexpr(tq);
  714.                       (* add upper bound of actual value *)
  715.                       if tq^.tnext = nil then
  716. !                         write(', ',
  717. !                             crange(tx^.taindx):1)
  718.                       end
  719.                   else begin
  720.                       if tf^.tup^.tt = nvarpar then
  721. --- 6588,6600 ----
  722.                       eexpr(tq);
  723.                       (* add upper bound of actual value *)
  724.                       if tq^.tnext = nil then
  725. !                         begin
  726. !                         write(', (');
  727. !                         eexpr(tx^.taindx^.thi);
  728. !                         write(' - ');
  729. !                         eexpr(tx^.taindx^.tlo);
  730. !                         write(' + 1)')
  731. !                         end
  732.                       end
  733.                   else begin
  734.                       if tf^.tup^.tt = nvarpar then
  735. ***************
  736. *** 6930,6944 ****
  737.                   eexpr(tp^.texps);
  738.                   write('.buf')
  739.                   end
  740. !             else if doarrow = 0 then
  741.                   begin
  742. !                 write('*');
  743. !                 eexpr(tp^.texps)
  744. !                 end
  745. !             else begin
  746.                   eexpr(tp^.texps);
  747.                   write('->');
  748.                   donearr := true
  749.                    end
  750.               end;
  751.             nid:
  752. --- 7002,7018 ----
  753.                   eexpr(tp^.texps);
  754.                   write('.buf')
  755.                   end
  756. !             else if doarrow then
  757.                   begin
  758. !                 doarrow := false;
  759.                   eexpr(tp^.texps);
  760.                   write('->');
  761.                   donearr := true
  762. +                 end
  763. +             else begin
  764. +                 write('(*');
  765. +                 eexpr(tp^.texps);
  766. +                 write(')')
  767.                    end
  768.               end;
  769.             nid:
  770. ***************
  771. *** 6947,6966 ****
  772.                  var-parameter or as a procedure-parameter *)
  773.               tq := idup(tp);
  774.               if tq^.tt = nvarpar then
  775. !                 begin
  776. !                 if (doarrow = 0) or
  777. !                         (tq^.tattr = areference) then
  778.                       begin
  779. !                     write('(*');
  780.                       printid(tp^.tsym^.lid);
  781. !                     write(')')
  782.                       end
  783.                   else begin
  784.                       printid(tp^.tsym^.lid);
  785. !                     write('->');
  786. !                     donearr := true
  787.                        end
  788. -                 end
  789.               else if (tq^.tt = nconst) and conflag then
  790.                   write(cvalof(tp):1)
  791.               else if tq^.tt in [nparproc, nparfunc] then
  792. --- 7021,7038 ----
  793.                  var-parameter or as a procedure-parameter *)
  794.               tq := idup(tp);
  795.               if tq^.tt = nvarpar then
  796. !                 if doarrow then
  797.                       begin
  798. !                     doarrow := false;
  799.                       printid(tp^.tsym^.lid);
  800. !                     write('->');
  801. !                     donearr := true
  802.                       end
  803.                   else begin
  804. +                     write('(*');
  805.                       printid(tp^.tsym^.lid);
  806. !                     write(')')
  807.                        end
  808.               else if (tq^.tt = nconst) and conflag then
  809.                   write(cvalof(tp):1)
  810.               else if tq^.tt in [nparproc, nparfunc] then
  811. ***************
  812. *** 7107,7112 ****
  813. --- 7179,7206 ----
  814.               end
  815.       end;    (* econst *)
  816.   
  817. +     (*    Undefine constants.                    *)
  818. +     procedure edconst(tp : treeptr);
  819. +     var    sp    : symptr;
  820. +     begin
  821. +         while tp <> nil do
  822. +             begin
  823. +             sp := tp^.tidl^.tsym;
  824. +             if tp^.tbind^.tt <> nstring then
  825. +                 begin
  826. +                 (* all non-strings are emitted as
  827. +                    preprocessor # defines *)
  828. +                 write(undef);
  829. +                 printid(sp^.lid);
  830. +                 writeln
  831. +                 end;
  832. +             tp := tp^.tnext
  833. +             end
  834. +     end;    (* edconst *)
  835.       (*    Emit a typedef.                        *)
  836.       procedure etypedef;
  837.   
  838. ***************
  839. *** 7867,7876 ****
  840.                 ncase:
  841.                   begin
  842.                   indent;
  843. !                 write('switch (');
  844.                   increment;
  845.                   eexpr(tp^.tcasxp);
  846. !                 writeln(') {');
  847.                   decrement;
  848.                   echoise(tp^.tcaslst);
  849.                   indent;
  850. --- 7961,7970 ----
  851.                 ncase:
  852.                   begin
  853.                   indent;
  854. !                 write('switch ((int)(');
  855.                   increment;
  856.                   eexpr(tp^.tcasxp);
  857. !                 writeln(')) {');
  858.                   decrement;
  859.                   echoise(tp^.tcaslst);
  860.                   indent;
  861. ***************
  862. *** 8052,8058 ****
  863.               indent;
  864.               writeln('  case 0:');
  865.               indent;
  866. !             writeln(tab1, 'break');
  867.               tq := tp^.tsublab;
  868.               while tq <> nil do
  869.                   begin
  870. --- 8146,8152 ----
  871.               indent;
  872.               writeln('  case 0:');
  873.               indent;
  874. !             writeln(tab1, 'break;');
  875.               tq := tp^.tsublab;
  876.               while tq <> nil do
  877.                   begin
  878. ***************
  879. *** 8071,8077 ****
  880.               indent;
  881.               writeln('  default:');
  882.               indent;
  883. !             writeln(tab1, 'Caseerror(Line)');
  884.               indent;
  885.               writeln('}')
  886.               end
  887. --- 8165,8171 ----
  888.               indent;
  889.               writeln('  default:');
  890.               indent;
  891. !             writeln(tab1, 'Caseerror(Line);');
  892.               indent;
  893.               writeln('}')
  894.               end
  895. ***************
  896. *** 8198,8203 ****
  897. --- 8292,8298 ----
  898.                   writeln(';');
  899.                   end;
  900.               decrement;
  901. +             edconst(tp^.tsubconst);
  902.               writeln('}');
  903.           999:
  904.               writeln;
  905. ***************
  906. *** 8337,8345 ****
  907.               writeln(define, 'Putl(f, v) (f).eoln = v')
  908.               end;
  909.           if use(dreset) or use(drewrite) or use(dclose) then
  910.               writeln(define, 'Finish(f) ((f).out && !(f).eoln) ? ',
  911.                   '(Putchr(', nlchr, ', f), 0) : 0, ',
  912. !                     'rewind((f).fp)');    (* LIB *)
  913.           if use(dclose) then
  914.               begin
  915.               writeln(define, 'Close(f) (f).init = ',
  916. --- 8432,8443 ----
  917.               writeln(define, 'Putl(f, v) (f).eoln = v')
  918.               end;
  919.           if use(dreset) or use(drewrite) or use(dclose) then
  920. +             begin
  921.               writeln(define, 'Finish(f) ((f).out && !(f).eoln) ? ',
  922.                   '(Putchr(', nlchr, ', f), 0) : 0, ',
  923. !                     '!fseek((f).fp, 0L, 0)'); (* LIB *)
  924. !             writeln(xtern, 'int', tab1, 'fseek();')    (* LIB *)
  925. !             end;
  926.           if use(dclose) then
  927.               begin
  928.               writeln(define, 'Close(f) (f).init = ',
  929. ***************
  930. *** 8359,8371 ****
  931.               writeln(elsif);
  932.               writeln(static, chartyp, tab1, 'Rmode[] = "r+";');
  933.               writeln(endif);
  934. !             writeln(define, 'Reset(f, n) (f).init = ',
  935. !                 '(f).init ? rewind((f).fp) : ',    (* LIB *)
  936. !                 '(((f).fp = Fopen(n, Rmode)), 1), ',
  937.                       '(f).eof = (f).out = 0, Get(f)');
  938. !             writeln(define, 'Resetx(f, n) (f).init = ',
  939.                   '(f).init ? (Finish(f)) : ',
  940. !                 '(((f).fp = Fopen(n, Rmode)), 1), ',
  941.                       '(f).eof = (f).out = 0, Getx(f)');
  942.               usefopn := true
  943.               end;
  944. --- 8457,8469 ----
  945.               writeln(elsif);
  946.               writeln(static, chartyp, tab1, 'Rmode[] = "r+";');
  947.               writeln(endif);
  948. !             writeln(define, 'Reset(f, n, l) (f).init = ',
  949. !                 '(f).init ? !fseek((f).fp, 0L, 0) : ', (* LIB *)
  950. !                 '(((f).fp = Fopen(n, l, Rmode)), 1), ',
  951.                       '(f).eof = (f).out = 0, Get(f)');
  952. !             writeln(define, 'Resetx(f, n, l) (f).init = ',
  953.                   '(f).init ? (Finish(f)) : ',
  954. !                 '(((f).fp = Fopen(n, l, Rmode)), 1), ',
  955.                       '(f).eof = (f).out = 0, Getx(f)');
  956.               usefopn := true
  957.               end;
  958. ***************
  959. *** 8376,8388 ****
  960.               writeln(elsif);
  961.               writeln(static, chartyp, tab1, 'Wmode[] = "w+";');
  962.               writeln(endif);
  963. !             writeln(define, 'Rewrite(f, n) (f).init = ',
  964. !                 '(f).init ? rewind((f).fp) : ',    (* LIB *)
  965. !                 '(((f).fp = Fopen(n, Wmode)), 1), ',
  966.                       '(f).out = (f).eof = 1');
  967. !             writeln(define, 'Rewritex(f, n) (f).init = ',
  968.                   '(f).init ? (Finish(f)) : ',
  969. !                 '(((f).fp = Fopen(n, Wmode)), 1), ',
  970.                       '(f).out = (f).eof = (f).eoln = 1');
  971.               usefopn := true
  972.               end;
  973. --- 8474,8486 ----
  974.               writeln(elsif);
  975.               writeln(static, chartyp, tab1, 'Wmode[] = "w+";');
  976.               writeln(endif);
  977. !             writeln(define, 'Rewrite(f, n, l) (f).init = ',
  978. !                 '(f).init ? !fseek((f).fp, 0L, 0) : ', (* LIB *)
  979. !                 '(((f).fp = Fopen(n, l, Wmode)), 1), ',
  980.                       '(f).out = (f).eof = 1');
  981. !             writeln(define, 'Rewritex(f, n, l) (f).init = ',
  982.                   '(f).init ? (Finish(f)) : ',
  983. !                 '(((f).fp = Fopen(n, l, Wmode)), 1), ',
  984.                       '(f).out = (f).eof = (f).eoln = 1');
  985.               usefopn := true
  986.               end;
  987. ***************
  988. *** 8389,8395 ****
  989.           if usefopn then
  990.               begin
  991.               writeln('FILE    *Fopen();');
  992. !             writeln(define, 'MAXFILENAME 256')
  993.               end;
  994.           if usecase or usejmps then
  995.               begin
  996. --- 8487,8495 ----
  997.           if usefopn then
  998.               begin
  999.               writeln('FILE    *Fopen();');
  1000. !             writeln(ifndef, maxfilename);
  1001. !             writeln(define, maxfilename, ' ', (maxtoknlen+1):1);
  1002. !             writeln(endif)
  1003.               end;
  1004.           if usecase or usejmps then
  1005.               begin
  1006. ***************
  1007. *** 8443,8449 ****
  1008.               write(' (');
  1009.               printid(defnams[dboolean]^.lid);
  1010.               writeln(')1');
  1011. !             writeln(xtern, chartyp, tab1, '*Bools[];')
  1012.               end;
  1013.           capital(defnams[dinteger]);
  1014.           if use(dinteger) then
  1015. --- 8543,8549 ----
  1016.               write(' (');
  1017.               printid(defnams[dboolean]^.lid);
  1018.               writeln(')1');
  1019. !             writeln(chartyp, tab1, '*Bools[];')
  1020.               end;
  1021.           capital(defnams[dinteger]);
  1022.           if use(dinteger) then
  1023. ***************
  1024. *** 8519,8527 ****
  1025.               writeln(setptyp, tab1, 'Insmem(), Mksubr();');
  1026.               writeln(setptyp, tab1, 'Currset(), Inter();');
  1027.               writeln(static, setptyp, tab1, 'Tmpset;');
  1028. !             writeln(xtern, setptyp, tab1, 'Conset[];');
  1029.               writeln(voidtyp, tab1, 'Setncpy();')
  1030.               end;
  1031.           writeln(xtern, chartyp, ' *strncpy();');    (* LIB *)
  1032.           if use(dargc) or use(dargv) then
  1033.               begin
  1034. --- 8619,8640 ----
  1035.               writeln(setptyp, tab1, 'Insmem(), Mksubr();');
  1036.               writeln(setptyp, tab1, 'Currset(), Inter();');
  1037.               writeln(static, setptyp, tab1, 'Tmpset;');
  1038. !             writeln(setptyp, tab1, 'Conset[];');
  1039.               writeln(voidtyp, tab1, 'Setncpy();')
  1040.               end;
  1041. +         if align then                    (* CPU *)
  1042. +             begin
  1043. +             writeln(ifndef, 'SETALIGN');
  1044. +             writeln(define, 'SETALIGN(x) Alignset(x)');
  1045. +             writeln('struct Set { ', wordtype, tab1, 'S[',
  1046. +                     maxsetrange:1, '+1]; } *Alignset();');
  1047. +             writeln(endif);
  1048. +             writeln(ifndef, 'STRALIGN');
  1049. +             writeln(define, 'STRALIGN(x) Alignstr(x)');
  1050. +             writeln('struct String { char    A[',
  1051. +                     maxtoknlen:1, '+1]; } *Alignstr();');
  1052. +             writeln(endif)
  1053. +             end;
  1054.           writeln(xtern, chartyp, ' *strncpy();');    (* LIB *)
  1055.           if use(dargc) or use(dargv) then
  1056.               begin
  1057. ***************
  1058. *** 8577,8589 ****
  1059. --- 8690,8711 ----
  1060.                   writeln('main()');
  1061.                   writeln('{')
  1062.                    end;
  1063. +             if use(dinput) then
  1064. +                 begin
  1065. +                 writeln(ifdef, 'STDINIT');
  1066. +                 writeln(tab1, voidcast, '(Getx(input));');
  1067. +                 writeln(endif)
  1068. +                 end;
  1069.               increment;
  1070.               elabel(tp);
  1071.               estmt(tp^.tsubstmt);
  1072.               indent;
  1073.               writeln('exit(0);');
  1074. +             indent;
  1075. +             writeln('/', '* NOTREACHED *', '/');
  1076.               decrement;
  1077.               writeln('}');
  1078. +             edconst(tp^.tsubconst);
  1079.               writeln('/', '*');
  1080.               writeln('**    End of program code');
  1081.               writeln('*', '/')
  1082. ***************
  1083. *** 8716,8725 ****
  1084.       conflag := false;
  1085.       setused := false;
  1086.       dropset := false;
  1087. !     doarrow := 0;
  1088.       eprogram(top);
  1089.       if usebool then
  1090. !         writeln(chartyp, tab1, '*Bools[] = { "false", "true" };');
  1091.       if usescan then
  1092.           begin
  1093.           writeln;
  1094. --- 8838,8848 ----
  1095.       conflag := false;
  1096.       setused := false;
  1097.       dropset := false;
  1098. !     doarrow := false;
  1099. !     donearr := false;
  1100.       eprogram(top);
  1101.       if usebool then
  1102. !         writeln(static, chartyp, tab1, '*Bools[] = { "false", "true" };');
  1103.       if usescan then
  1104.           begin
  1105.           writeln;
  1106. ***************
  1107. *** 8749,8770 ****
  1108.           begin
  1109.           writeln;
  1110.           writeln(static, 'FILE *');
  1111. !         writeln('Fopen(n, m)');
  1112.           writeln(chartyp, tab1, '*n, *m;');
  1113.           writeln('{');
  1114.           writeln(tab1, 'FILE', tab2, '*f;');
  1115.           writeln(tab1, registr, chartyp, tab1, '*s;');
  1116.           writeln(tab1, static, chartyp, tab1, 'ch = ',
  1117.                           quote, 'A', quote, ';');
  1118. !         writeln(tab1, static, chartyp, tab1, 'tmp[MAXFILENAME];');
  1119. !         writeln(tab1, xtern , inttyp, tab1, 'unlink();'); (* OS *)
  1120.           writeln;
  1121.           writeln(tab1, 'if (n == NULL)');
  1122.           writeln(tab2, 'sprintf(tmp, ', tmpfilename, 'ch++);');
  1123.           writeln(tab1, 'else {');
  1124.           writeln(tab2, 'strncpy(tmp, n, sizeof(tmp));');
  1125.           writeln(tab2, 'for (s = &tmp[sizeof(tmp)-1]; *s == ',
  1126. !             spchr, ' || *s == ', nulchr, '; )');
  1127.           writeln(tab3, '*s-- = ', nulchr, ';');
  1128.           writeln(tab2, 'if (tmp[sizeof(tmp)-1]) {');
  1129.           writeln(tab3, voidcast, 'fprintf(stderr, "Too long filename ',
  1130. --- 8872,8897 ----
  1131.           begin
  1132.           writeln;
  1133.           writeln(static, 'FILE *');
  1134. !         writeln('Fopen(n, l, m)');
  1135.           writeln(chartyp, tab1, '*n, *m;');
  1136. +         writeln(inttyp, tab1, 'l;');
  1137.           writeln('{');
  1138.           writeln(tab1, 'FILE', tab2, '*f;');
  1139.           writeln(tab1, registr, chartyp, tab1, '*s;');
  1140.           writeln(tab1, static, chartyp, tab1, 'ch = ',
  1141.                           quote, 'A', quote, ';');
  1142. !         writeln(tab1, static, chartyp, tab1, 'tmp[', maxfilename, '];');
  1143. !         writeln(tab1, xtern , inttyp, tab1, 'unlink(),'); (* OS *)
  1144. !         writeln(tab3, 'strlen();'); (* OS *)
  1145.           writeln;
  1146.           writeln(tab1, 'if (n == NULL)');
  1147.           writeln(tab2, 'sprintf(tmp, ', tmpfilename, 'ch++);');
  1148.           writeln(tab1, 'else {');
  1149. +         writeln(tab2, 'if (l < 0)');
  1150. +         writeln(tab3, 'l = strlen(n);');
  1151.           writeln(tab2, 'strncpy(tmp, n, sizeof(tmp));');
  1152.           writeln(tab2, 'for (s = &tmp[sizeof(tmp)-1]; *s == ',
  1153. !             spchr, ' || *s == ', nulchr, ' || s - tmp > l; )');
  1154.           writeln(tab3, '*s-- = ', nulchr, ';');
  1155.           writeln(tab2, 'if (tmp[sizeof(tmp)-1]) {');
  1156.           writeln(tab3, voidcast, 'fprintf(stderr, "Too long filename ',
  1157. ***************
  1158. *** 8782,8788 ****
  1159.           writeln(tab2, 'unlink(tmp);');    (* OS *)
  1160.           writeln(tab1, 'return (f);');
  1161.           writeln('}');
  1162. -         writeln(xtern, inttyp, tab1, 'rewind();')
  1163.           end;
  1164.       if setcnt > 0 then
  1165.           econset(setlst, setcnt);
  1166. --- 8909,8914 ----
  1167. ***************
  1168. *** 9098,9106 ****
  1169.           writeln(tab2, '*S1++ = 0;');
  1170.           writeln('}')
  1171.           end;
  1172. !     if usecase then
  1173.           begin
  1174.           writeln;
  1175.           writeln(static, voidtyp);
  1176.           writeln('Caseerror(n)');
  1177.           writeln(tab1, inttyp, tab1, 'n;');
  1178. --- 9224,9263 ----
  1179.           writeln(tab2, '*S1++ = 0;');
  1180.           writeln('}')
  1181.           end;
  1182. !     if usesal then
  1183.           begin
  1184.           writeln;
  1185. +         writeln(static, 'struct Set *');
  1186. +         writeln('Alignset(Sp)');
  1187. +         writeln(tab1, registr, wordtype, tab1, '*Sp;');
  1188. +         writeln('{');
  1189. +         writeln(tab1, static, 'struct Set', tab1, 'tmp;');
  1190. +         writeln(tab1, registr, wordtype, tab1, '*tp = tmp.S;');
  1191. +         writeln(tab1, registr, inttyp, tab2, 'i = *Sp;');
  1192. +         writeln;
  1193. +         writeln(tab1, 'while (i-- >= 0)');
  1194. +         writeln(tab2, '*tp++ = *Sp++;');
  1195. +         writeln(tab1, 'return (&tmp);');
  1196. +         writeln('}')
  1197. +         end;
  1198. +     if usealig then
  1199. +         begin
  1200. +         writeln;
  1201. +         writeln(static, 'struct String *');
  1202. +         writeln('Alignstr(Cp)');
  1203. +         writeln(tab1, registr, chartyp, tab1, '*Cp;');
  1204. +         writeln('{');
  1205. +         writeln(tab1, static, 'struct String', tab1, 'tmp;');
  1206. +         writeln(tab1, registr, chartyp, tab1, '*sp = tmp.A;');
  1207. +         writeln;
  1208. +         writeln(tab1, 'while (*sp++ = *Cp++)');
  1209. +         writeln(tab2, ';');
  1210. +         writeln(tab1, 'return (&tmp);');
  1211. +         writeln('}')
  1212. +         end;
  1213. +     if usecase or usejmps then
  1214. +         begin
  1215. +         writeln;
  1216.           writeln(static, voidtyp);
  1217.           writeln('Caseerror(n)');
  1218.           writeln(tab1, inttyp, tab1, 'n;');
  1219. ***************
  1220. *** 9108,9113 ****
  1221. --- 9265,9271 ----
  1222.           writeln(tab1, voidcast,
  1223.               'fprintf(stderr, "Missing case limb: line %d\n", n);');
  1224.           writeln(tab1, 'exit(1);');
  1225. +         writeln(tab1, '/', '* NOTREACHED *', '/');
  1226.           writeln('}')
  1227.           end;
  1228.       if usemax then
  1229. ***************
  1230. *** 9153,9158 ****
  1231. --- 9311,9318 ----
  1232.       t    : pretyps;
  1233.       d    : predefs;
  1234.   
  1235. +     hx    : packed array [ 1 .. 16 ] of char;
  1236.       (*    Define names in ctable.                    *)
  1237.       procedure defname(cn : cnames; str : keyword);
  1238.   
  1239. ***************
  1240. *** 9328,9339 ****
  1241.   begin    (* initialize *)
  1242.       lineno := 1;
  1243.       colno := 0;
  1244.   
  1245.       initstrstore;
  1246.   
  1247.       setlst := nil;
  1248.       setcnt := 0;
  1249. !     hexdig := '0123456789ABCDEF';
  1250.   
  1251.       symtab := nil;
  1252.       statlvl := 0;
  1253. --- 9488,9501 ----
  1254.   begin    (* initialize *)
  1255.       lineno := 1;
  1256.       colno := 0;
  1257. +     pushed := false;
  1258.   
  1259.       initstrstore;
  1260.   
  1261.       setlst := nil;
  1262.       setcnt := 0;
  1263. !     hx := '0123456789ABCDEF';
  1264. !     unpack(hx, hexdig, 0);
  1265.   
  1266.       symtab := nil;
  1267.       statlvl := 0;
  1268. ***************
  1269. *** 9366,9371 ****
  1270. --- 9528,9535 ----
  1271.   
  1272.       usecomp := false;
  1273.       usemax    := false;
  1274. +     usealig    := false;
  1275. +     usesal    := false;
  1276.   
  1277.       for s := 0 to hashmax do
  1278.           idtab[s] := nil;
  1279. ***************
  1280. *** 9541,9546 ****
  1281. --- 9705,9713 ----
  1282.       defname(cungetc,    'ungetc    ');    (* LIB *)
  1283.       defname(cunion,        'union     ');
  1284.       defname(cunlink,    'unlink    ');    (* OS *)
  1285. +     defname(cfseek,        'fseek     ');    (* LIB *)
  1286. +     defname(cgetchar,    'getchar   ');    (* LIB *)
  1287. +     defname(cputchar,    'putchar   ');    (* LIB *)
  1288.       defname(cunsigned,    'unsigned  ');
  1289.       defname(cwrite,        'write     ');    (* OS *)
  1290.   
  1291. ***************
  1292. *** 9613,9619 ****
  1293.              describing type, fill in constant identifying type *)
  1294.           case t of
  1295.             tboolean:
  1296. !             typnods[t] := deftab[dboolean]; (* scalar type *)
  1297.             tchar:
  1298.               typnods[t] := deftab[dchar]^.tbind;
  1299.             tinteger:
  1300. --- 9780,9786 ----
  1301.              describing type, fill in constant identifying type *)
  1302.           case t of
  1303.             tboolean:
  1304. !             typnods[t] := deftab[dboolean]^.tbind;
  1305.             tchar:
  1306.               typnods[t] := deftab[dchar]^.tbind;
  1307.             tinteger:
  1308.